//
//  XDLMExpectTableViewCell.m
//  xindailianmeng
//
//  Created by 于于 on 17/3/1.
//  Copyright © 2017年 xindailianmeng.cn. All rights reserved.
//

#import "XDLMExpectTableViewCell.h"

@implementation XDLMExpectTableViewCell

-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self creatview];
    }
    return self;
}

-(id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self creatview];
    }
    return self;
}
-(void)creatview
{
    _periods = [self createLabelWithFrame:CGRectMake(0, 0, kScreenW/3*kscale, 33) text:@"期数" textFont:[UIFont systemFontOfSize:14] textColor:kColorRGB(102, 102, 102)];
    [_periods setTextAlignment:NSTextAlignmentCenter];
    [self.contentView addSubview:_periods];
    
    _collectionDate = [self createLabelWithFrame:CGRectMake(kScreenW/3*kscale, 0, kScreenW/3*kscale, 33) text:@"收款日" textFont:[UIFont systemFontOfSize:14] textColor:kColorRGB(102, 102, 102)];
     [_collectionDate setTextAlignment:NSTextAlignmentCenter];
    [self.contentView addSubview:_collectionDate];
    
    _income = [self createLabelWithFrame:CGRectMake(kScreenW/3*kscale*2, 0, kScreenW/3*kscale, 33) text:@"期数" textFont:[UIFont systemFontOfSize:14] textColor:kColorRGB(102, 102, 102)];
     [_income setTextAlignment:NSTextAlignmentCenter];
    [self.contentView addSubview:_income];
}

-(void)setDataDic:(NSDictionary *)dataDic
{
    [_periods setText:@""];
    [_collectionDate setText:@""];
    [_income setText:@""];
}
#pragma mark --- 生成label
- (UILabel *)createLabelWithFrame:(CGRect)frame text:(NSString *)text textFont:(UIFont *)font textColor:(UIColor *)color {
    
    UILabel * label = [[UILabel alloc] initWithFrame:frame];
    label.text = text;
    label.textColor = color;
    label.font = font;
    label.adjustsFontSizeToFitWidth = YES;
    label.textAlignment = NSTextAlignmentCenter;
    
    return label;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
